﻿<!--#include file="Conn.asp"-->
<%
	Private Function Getname()
		Dim y, m, d, h, mm, S, r
		Randomize
		y = Year(Now)
		m = right("00" & Month(Now),2)
		d = right("00" & Day(Now),2)
		h = right("00" & Hour(Now),2)
		mm =right("00" & Minute(Now),2)
		S = right("00" & Second(Now),2)
		r = 0
		r=Int(10001*Rnd)
		S = right("000000" & r,4)
		Getname = y & m & d & h & mm & S & r
	End Function
fileid=Getname()
filename=Request.Form("filename")
filedesc=Request.Form("message")
Response.Write(filename)
upup=Request.Form("upup")
uploaduser=session("username")
uploadtime=date()
viewtimes=0
filestate=0
filestar=0
if upup="text1" then
filelocation=Request.Form("filelocation")
filetype="dz"
else
filelocation=Request.Form("fileurl")
filetype="lj"
end if
if filename="" or filedesc="" or upup="" or filelocation="" then
    Response.Write "<Script>alert('请重新输入！');history.go(-1);</Script>"
    Response.End
end if
filedesc=Request.Form("message")
sql="INSERT INTO resource VALUES ('"&fileid&"','"&filename&"','"&uploaduser&"','"&uploadtime&"',0,0,0,'"&filetype&"','"&filedesc&"','"&filelocation&"','all')"
Conn.execute sql
Response.Redirect("view.asp?fileid="&fileid&"")
%>